package com.skit.common.ktx

import com.skit.common.bean.StatusResult
import com.skit.common.http.NetResult

fun <T> StatusResult<T>.init(): NetResult<T> {
    if (status == 200) {
        return if (data != null) NetResult.DataSuccess(data) else NetResult.Success(data)
    } else {
        return NetResult.Error(status, msg)
    }
}